package tech.aistar.service.impl;

import org.apache.ibatis.session.SqlSession;
import tech.aistar.mapper.PhoneDetailsMapper;
import tech.aistar.pojo.PhoneDetails;
import tech.aistar.service.IPhoneDetailsService;
import tech.aistar.until.MybatisUtil;

/**
 * @author Ray
 * @version 1.0
 * @description:本类用来演示:
 * @date 2019/9/13  15:23
 */
public class PhoneDetailsServiceImpl implements IPhoneDetailsService {

    @Override
    public PhoneDetails getByPhoneId(Integer phoneId) {
        SqlSession sqlSession = MybatisUtil.getSqlSession();

        PhoneDetailsMapper mapper = sqlSession.getMapper(PhoneDetailsMapper.class);

        PhoneDetails phoneDetail = mapper.getByPhoneId(phoneId);

        sqlSession.commit();

        MybatisUtil.close(sqlSession);

        return phoneDetail;
    }
}
